1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package net.sf.webphotos.entity;
17
18
19
20
21
22 public abstract class PhotoEntity implements IsPhoto {
23
24 @Override
25 public int compareTo(IsPhoto o2) {
26 return this.getKey().compareTo(o2.getKey());
27 }
28
29 @Override
30 public int hashCode() {
31 return this.getKey().hashCode();
32 }
33
34 @Override
35 public boolean equals(Object obj) {
36 if (obj == null) {
37 return false;
38 }
39 if (getClass() != obj.getClass()) {
40 return false;
41 }
42 final PhotoEntity other = (PhotoEntity) obj;
43
44 return this.getKey().equals(other.getKey());
45 }
46
47 }